﻿using System;
using System.Globalization;
using System.Text.RegularExpressions;

namespace Ex6DoubleParser
{
    class Program
    {
        static void Main()
        {
            string[] array = { "123 456 789,12", "123 456 789.34","123456789,56","123456789.78"};
            foreach (var word in array)
            {
                string numberAsString = word.Replace(',', '.');
                numberAsString = Regex.Replace(numberAsString,@"[\s]","");
                double number = double.Parse(numberAsString, NumberStyles.Number, new CultureInfo("en-GB"));
                Console.WriteLine(number);
            }            
        }
    }
}
